#include <QGuiApplication>
#include <QQmlApplicationEngine>
#include <QQuickStyle>

int main(int argc, char *argv[])
{
    QGuiApplication app(argc, argv);
#if 1
    // 修改控价风格
    QQuickStyle::setStyle("Material"); // 扁平化
#endif

    QQmlApplicationEngine engine;
    // 这里url的URI,要和CMakeLists.txt中通过qt_add_qml_module添加的URI保持一致
    const QUrl url(u"qrc:/chapter4-2MoveToMobile/Main.qml"_qs);
    QObject::connect(&engine, &QQmlApplicationEngine::objectCreationFailed,
        &app, []() { QCoreApplication::exit(-1); },
        Qt::QueuedConnection);
    engine.load(url);

    return app.exec();
}
